<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" >
<head>
    <meta charset="UTF-8">
    <title>个人中心</title>
</head>
<body>
<p th:text="欢迎用户+${nickname}"></p>
<a th:href="@{/logout}">注销</a>

<p>好友列表：<span th:text="${friends.size()}"></span></p>
<table>
    <tr th:each="friend : ${friends}">
        <td th:text="${friend.getNickname()}"></td>
    </tr>
</table>
<br/>
<p>申请列表：<span th:text="${applyUserList.size()}"></span></p>
<table>
    <tr th:each="apply : ${applyUserList}">
        <td>
            <span th:text="${apply.getNickname()}"></span>
            <a th:href="@{'/addFriend/received/'+${apply.getId()}}">同意</a>
        </td>
    </tr>
</table>
<br/>
<p>正在申请中：<span th:text="${myApplyUserList.size()}"></span></p>
<table>
    <tr th:each="myApply : ${myApplyUserList}">
        <td>
            <span th:text="${myApply.getNickname()}"></span>
            <a>申请中</a>
        </td>
    </tr>
</table>
<br/>
<p>我的群组：<span th:text="${myGroups.size()}"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a th:href="@{/toAddGroupPage}">创建</a></p>
<table>
    <tr th:each="group : ${myGroups}">
        <td><a th:href="@{'/group/'+${group.getId()}}" th:text="${group.getGname()}"></a></td>
        <td>
            <form th:action="@{'/group/'+${group.getId()}}" method="post">
                <input type="hidden" name="_method" value="delete">
                <input type="submit" value="删除">
            </form>
        </td>
    </tr>
</table>
<br/>
<p>所有群组：<span th:text="${allGroups.size()}"></span></p>
<table>
    <tr th:each="group : ${allGroups}">
        <td><a th:href="@{'/group/'+${group.getId()}}" th:text="${group.getGname()}"></a></td>
    </tr>
</table>

<br/>
<p>推荐好友：<span th:text="${recommendUser.size()}"></span></p>
<table>
    <tr th:each="otherUser : ${recommendUser}">
        <td><a th:text="${otherUser.getNickname()}" th:href="@{'/user/'+${otherUser.getId()}}"></a></td>
        <td><a th:href="@{'/addFriend/'+${otherUser.getId()}}">加好友</a></td>
    </tr>
</table>
</body>
</html>